﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace QuickFramework.UICore.Controllers.Books
{
    /// <summary>
    /// 标签
    /// </summary>
    [Area("Books")]
    public class GoodsTagController : Shared.Contracts.AuthorizeControllerBase
    {
        BookStores.IDomain.IGoodsTag m_IGoodsTag = null;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="goodsTag"></param>
        public GoodsTagController(BookStores.IDomain.IGoodsTag goodsTag)
        {
            m_IGoodsTag = goodsTag;
        }

        /// <summary>
        /// 查询指定类型的标签
        /// </summary>
        /// <param name="keyWord"></param>
        /// <param name="tagType"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> SearchTags(string keyWord, string tagType, int pageIndex = 1, int pageSize = 10)
        {
            return Ok(await m_IGoodsTag.GetGoodsTag(keyWord, tagType, pageIndex, pageSize));
        }
    }
}
